<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/commons/taglibs.jsp" %>
<head>
<%@ include file="/commons/css_js_head.jsp" %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>增加字典</title>
<script type="text/javascript">
//复写Url
doSaveUrl = "${ctx }/permission/efDictionaryAction!doSave.ts";
doReturnUrl = "${ctx }/permission/efDictionaryAction!doList.ts";
		
//保存
function doSave(){
   var _form = document.forms[0];
   if(doSaveUrl == ''){
   	alert('请设置正确的URL!');
   	return false;
   }

   _form.action = doSaveUrl;
}

//校验数据
$(document).ready(function(){
	
	$.formValidator.initConfig({formid:"form1",alertmessage:true,onerror:function(msg){alert(msg)},onsuccess:function(){doSave();}});
	
	$("#efDictionary_id_groupname").formValidator().inputValidator({min:1,max:32,onerror:"请输入组名，组名应以Dic开头，且只能在1-32个字符之间"});
	$("#efDictionary_remark").formValidator().inputValidator({min:1,max:64,onerror:"请输入描述，且只能在1-64个汉字之间"});
	$("#efDictionary_id_itemvalue").formValidator().inputValidator({min:1,max:2,onerror:"请输入值，且只能在1-2个字符之间"});
	$("#efDictionary_itemname").formValidator().inputValidator({min:1,max:16,onerror:"请输入名称，且只能在1-16个汉字之间"});

});
</script>	
</head>
<body style="overflow-x:hidden">
<div class="mTitle">
  <span class="hidsearch"></span>
  <b class="bbig">增加字典</b>带<b class="fred"> * </b>号为必填项
</div>

<s:form action="/permission/efDictionaryAction" method="post" id="form1" theme="simple">
<!--list -->
<div class="mainList">
				<table class="addTable">
					
					<tr>
						<th width="5%">
							<b class="fred">*</b>组名：
						</th>
						<td width="40%">
							<s:textfield id="efDictionary_id_groupname" name="efDictionary.id.groupname" maxlength="32" theme="simple"></s:textfield>
						</td>
					</tr>
					<tr>
						<th width="5%">
							<b class="fred">*</b>描述：
						</th>
						<td width="40%">
							<s:textfield id="efDictionary_remark" name="efDictionary.remark" maxlength="64" theme="simple"></s:textfield>
						</td>
					</tr>					
					<tr>
						<th width="5%">
							<b class="fred">*</b>类型：
						</th>
						<td width="40%">
							<select name="efDictionary.type">
								<ef:option groupname="DicDicType" selectedValue="${efDictionary.type}" link="true"></ef:option>
							</select>
						</td>
					</tr>					
					<tr>
						<th width="5%">
							<b class="fred">*</b>值：
						</th>
						<td width="40%">
							<s:textfield id="efDictionary_id_itemvalue" name="efDictionary.id.itemvalue" maxlength="2" theme="simple"></s:textfield>
						</td>
					</tr>	
					<tr>
						<th width="5%">
							<b class="fred">*</b>名称：
						</th>
						<td width="40%">
							<s:textfield id="efDictionary_itemname" name="efDictionary.itemname" maxlength="16" theme="simple"></s:textfield>
						</td>
					</tr>
					<tr>
						<th width="5%">
							过滤条件：
						</th>
						<td width="40%">
							<s:textfield id="efDictionary_filter" name="efDictionary.filter" maxlength="31" theme="simple"></s:textfield>
						</td>
					</tr>
					<tr>
						<th width="5%">
							执行语句：
						</th>
						<td width="40%">
							<s:textarea id="efDictionary_exesql" name="efDictionary.exesql" theme="simple" cssStyle="width:400px"></s:textarea>
						</td>
					</tr>
				</table>

</div>
<!--end table -->

<div class="addToolbar">
    <p>
    <input class="btn" name="btn_confirm" value="确定" type="submit"/>
    <input class="btn" name="btn_return" value="返回" type="button" onclick="doReturn();"; />
    </p>
</div>
</s:form>

</body>
</html>